#include "SeqQueue.h"
#include <string.h>

typedef struct PERSON {
    char name[64];
    int age;
}Person;

int main() {
    //创建队列
    SeqQueue* queue = Init_SeqQueue();
    //创建数据
    Person p1,p2,p3,p4,p5;
    strcpy(p1.name,"aaa");
    strcpy(p2.name,"bbb");
    strcpy(p3.name,"ccc");
    strcpy(p4.name,"ddd");
    strcpy(p5.name,"eee");

    p1.age = 18;
    p2.age = 19;
    p3.age = 20;
    p4.age = 21;
    p5.age = 22;

    Push_SeqQueue(queue,&p1);
    Push_SeqQueue(queue,&p2);
    Push_SeqQueue(queue,&p3);
    Push_SeqQueue(queue,&p4);
    Push_SeqQueue(queue,&p5);

    //输出队尾元素
    Person* backP = (Person*)Back_SeqQueue(queue);
    printf("Name:%s\tAge:%d\n",backP->name,backP->age);
    printf("============================================\n");

    while (Size_SeqQueue(queue) > 0) {
        //取出队头元素
        Person* p = (Person*)Pop_SeqQueue(queue);;
        printf("Name:%s\tAge:%d\n",p->name,p->age);
    }

    //销毁
    FreeSpace_SeqQueue(queue);

    return 0;
}